<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>

    console.log(typeof x) // undefined
    var x

    console.log(typeof y) // ReferenceError:
    let y

    function bar(x = y, y = 2) {
        return [x, y];
    }

    bar(); // 报错
</script>
</body>
</html>